import jdk.internal.org.objectweb.asm.tree.MultiANewArrayInsnNode;

import java.util.Random;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        while(a != 0){
            System.out.println(a % 10);
            a /= 10;
        }
    }
    public static void main5(String[] args) {
        int count = 0;

        //数字一到100出现多少个数字9
        for (int i = 1; i <= 100; i++){
            if(i % 10 == 9){
                count++;
            }
            if (i / 10 == 9) {
                count++;
            }
        }
        System.out.println(count);
    }
    public static void main4(String[] args) {
        int i = 1;
        int j = 1;
        for(i = 2; i <= 100; i++){
            for ( j = 2; j < i ; j++) {
                if(i % j == 0){
                    //System.out.println("不是素数！");
                    break;


                }

                }
            if(i == j ){
                System.out.println(i);
            }
        }
    }
    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random random = new Random();
        int a = random.nextInt(50)+50;
        System.out.println("作弊"+a);
        while(true){
            System.out.println("请输入数字：");
            int num = sc.nextInt();
            if(num < a){
                System.out.println("猜小了！");
            } else if (num > a) {
                System.out.println("猜大了！");
            }else{
                System.out.println("猜对了！");
            }

        }

    }
    public static void main2(String[] args) {
        for(int i = 1;i <= 9;i++){
            for (int j = 1; j <=i ; j++) {
                System.out.print(j+"*"+i+"="+j*i+"  ");
            }
            System.out.println(" ");
        }
    }
    public static void main1(String[] args) {
        int i =1;
        while(i <= 100){
            //i++;
            if(i%5==0 && i%6==0){
                System.out.println(i);
                i++;
                continue;
            }
            i++;
        }

    }
}
